package com.lmx.common.constants;

/**
 * TODO(用一句话描述该文件做什么)
 *
 * @author ytche
 * @date 2017年6月20日
 *
 */
public enum LeaveStatus {
	LEAVE_ALLOWED(0, "已请假"), LEAVING(1, "请假中"), LEAVE_COMPLETE(2, "已完成");
	private LeaveStatus(Integer value, String name) {
		this.name = name;
		this.value = value;
	}

	private Integer value;
	private String name;

	public Integer getValue() {
		return value;
	}

	public void setValue(Integer value) {
		this.value = value;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public static LeaveStatus findByVlaue(Integer value) {
		for (LeaveStatus e : LeaveStatus.values()) {
			if (e.getValue().equals(value)) {
				return e;
			}
		}
		return null;
	}
}
